0

Backup and Restore Family Historian Settings via Windows

This plugin backs up and restores Family Historian settings using Windows commands rather than being managed directly by the plugin. This alternative approach has a number of advantages over what is possible using conventional plugins.

  • We are exploiting the ability of Windows to manage regional variations in language and other settings, rather than having to build a lot complexity into the plugin to cope with this variability. This makes the plugin much simpler in its operation, with benefits in reliability and ease of maintenance.
  • With Windows managing the copying operations rather than Family Historian, the copy and restore operation runs much more quickly (at least five times the speed when writing to fast link such as an internal hard disk or USB3 disk), and enables continued use of Family Historian while writing to a slow link such as a USB memory stick.
  • Restoring Registry settings is fully automatic, without the need to manually close Family Historian in order to complete the process.
  • It is not necessary to have Family Historian open to backup or restore its settings. This means that more advanced users can use the output of the plugin to create backups at any time. Typical applications would be either by a direct “Backup Family Historian Settings” shortcut, or automated backups that run silently in the background at predetermined intervals.

Principle of operation

Family Historian stores its various user configurations and custom features in a variety of different locations, as explained in this FHUG Knowledge Base article. These customisations are not included in the standard backup options within the program, and will frequently not be included in users’ more general backup strategies as they are split between the Registry and Windows folders, rather than being in the usual Windows user file locations.

Saving and restoring these custom features is an essential part of using Family Historian. Without them, the user loses all their program customisations and custom features such as plugins, queries, language packs and fact sets.

Backing up user features and settings requires saving the contents of two Windows folders and two Registry keys (one each for system and individual user customisations). The traditional approach is to use a Family Historian plugin that manages all the copying and processing. However, limitations in the plugin language make this increasingly complex to cater for international features such as different languages and alphabets while still supporting earlier versions of Family Historian.

An alternative approach is to manage this copying entirely within Windows, as this is a global product designed to be fully compatible with languages across the world. This plugin generates simple Windows shell scripts (historically known as “batch files”, but also called “command scripts”) that manage the required selection and copying.

General users do not need to know anything about these scripts, as using the plugin is simply a matter of selecting the folder to store the backups and configuring options, and all user interaction is presented in simple terms that all Family Historian users will be familiar with.

The plugin also has an “advanced” mode, which generates and saves the script files but does not run them directly. This gives more technically-minded users the ability to use or adapt these scripts to create their own personal backup strategy, including fully automatic backups that run silently in the background.

Scope

The plugin copies all settings from the relevant ProgramData and AppData folders, and in the Windows Registry. This includes custom Queries, Facts Sets, Reports, Diagrams, loaded plugins, and other customisations, but does not include any Project data, media, or image files incorporated into Reports and Diagrams unless they are stored in these folders (which is not advised). Family Historian 6 icon files are also excluded if they are located outside these folders.

The plugin runs on any PC running Windows 7 Service Pack 1 or later, including the now largely obsolete 32-bit versions of Windows. From Version 1.1, it also supports use under WINE on MacOS or Linux.

Initial folder selection

The plugin has a single menu screen, shown below. It always opens in this standard configuration.

Click on Select to select the folder where the backup is to be stored. Note that due to Windows limitations, this folder name cannot contain accented letters or other non-Latin characters. If you select such a folder, the plugin will point out the error and request a new selection.

Once the backup destination folder has been selected, the Backup button becomes active.

Running a backup

The backup is always created as a complete copy of all current user settings and customisations, apart from the stored map cache. Two subfolders are created automatically, plus two files containing the extracted Registry keys. If Write to dated subfolder is selected, a new subfolder is created with a name of the form fhBackup_yyyy-mm-dd, where yyyy-mm-dd represents the date the backup is run, and the backup stored there (when Advanced mode is selected, this can be modified in the backup script generated by the plugin). This enables multiple backups to be saved if you want to be able to revert to a previous configuration, analogous to project “snapshots”. If this option is not selected, any backup already stored in the specified folder is updated to mirror the current configuration.

To run the backup, simply click on the Backup button. If there is already a backup in the selected folder, the plugin will report when it was generated and request permission to update it. Once the backup has completed, it will present a summary of the results in the form shown below. Press any key (with this window selected) to dismiss the report and return to Family Historian.

Restoring a backup

To run the restore, simply click on the Restore button. Select the folder where the backup is stored (which doesn’t have to be the same folder as displayed for new backups), and click on OK. The plugin presents the date and time that the backup was last updated in order for the user to confirm that the correct one has been selected.

There are challenges in restoring Family Historian settings while the program is running, as many settings are read when the application starts up, and saved back to disk when it closes, overwriting any external change made in the meantime. This plugin overcomes that problem by closing Family Historian automatically and only restoring settings once it is fully closed. A dialogue box requests explicit approval from the user to proceed with the restore, and accepting this closes the program and initiates the restore, which typically takes only a very short time to run. The command window that is managing the restore stays open at the end of the process for the user to review any messages or status updates, in a similar format to that shown above for backup. Press any key to dismiss the window.

Next time Family Historian is opened, it will be configured as per the restored settings, with one minor exception. The default project name and location of default project and backup folders are excluded from the restore operation, as these may be different on the PC that the settings are restored to compared with the backup. Simply reset these to your preferred values within Family Historian.

Restoring a backup created by Backup and Restore Family Historian Settings

The Backup and Restore Family Historian Settings plugin has been available in the Plugin Store since the days of Family Historian 5. Although this is a much more complex plugin that manages all the file and Registry manipulation within Family Historian, the final output is very similar to that of this plugin. This enables the Windows plugin to restore backups created by the older alternative.

The process for restoring a backup created by the older plugin is identical to that described above. Select the folder containing the backup, and the plugin will first search for a backup created by the new Windows plugin. If it does not find one, it then searches for one in the older format. If neither are present, an error is reported.

Advanced mode

The standard configuration described up to now allows any user to use this plugin to backup and restore Family Historian settings without having to be familiar with how Windows shell scripts work. The plugin creates appropriate scripts as they are needed, starts them running to perform the backup or restore operation, and deletes them when they are no longer required.

Advanced mode is for users who prefer to limit the plugin activity to creating suitable prototype script templates that they can then incorporate into their own individual backup strategy. In this mode, the Backup and Restore buttons simply save the scripts that implement the selected backup and restore options to files in the specified backup folder.

The scripts created are conventional Windows shell scripts that can be run directly from Windows File Explorer by double-clicking on the file name. Alternatively, they can be started from a custom shortcut, or called from another process, exactly analogous to how Family Historian calls them to carry out the requested backup or restore operation.

Most significantly, these scripts are completely independent of Family Historian. They can be run at any time, say from a manual backup shortcut placed on the user’s desktop, or scheduled as a regular activity using Windows Task Scheduler, such that regular backups run automatically at predetermined intervals.

Users who are familiar with creating and using such shell scripts could even create their own without ever using the plugin. The plugin simply provides prototype, but fully functional, scripts that implement the options and destination specified in the plugin menu. These can be used “as is”, or modified as required.

Note that when the plugin is used to create and restore backups directly, it manages activity such as overwrite warnings and selection of the correct files and folders. Advanced users who create and modify their own scripts also take on the responsibility of ensuring that they are constructed correctly!

Other buttons

The Help button links to this page.

The Close button closes the plugin, saving your options automatically.

Use on MacOS or Linux

From Version 1.1 onwards, the plugin also supports use on MacOS or Linux under WINE (either raw WINE or packaged inside a product such as CrossOver or PlayOnLinux). There are some differences in how the plugin functions in this environment compared with native Windows.

The main difference is that WINE does not support the robocopy command used in Windows to copy complete folders to new locations, so has to fall back on the older and less powerful xcopy command. This gives slightly slower operation when updating an existing backup, and the detailed reporting screen looks different to the robocopy copy shown above. In addition, CrossOver does not support the automatic closing of Family Historian, so for simplicity a prompted manual close is required in all variants of WINE.

Despite these cosmetic differences, the core backup and restore functionality is identical under both WINE and native Windows, and the backups are fully compatible with each other, meaning that settings can be readily transferred between Windows and Mac/Linux PCs.

Typical use scenarios

Saving settings for restoring to the same PC, usually after maintenance, upgrading, or disaster recovery.

Keeping an up-to-date backup makes it much easier to restore Family Historian to your preferred configuration (which includes features such as custom Fact Sets, Queries and Plugins, as well as the wide variety of custom preferences and settings). The recommended method is to save your settings backup to somewhere that you backup regularly as part of your normal computer use, such as a dedicated settings folder in your Documents library, or on a removable external drive.

If you need to restore your settings into a new installation of Family Historian, the easiest method is to follow these simple steps:

  • Install the latest update to your version of Family Historian, and allow it to activate if version 7.
  • Download this plugin from the Plugin Store and install.
  • Run the Restore as described above.

More experienced users working directly with the Windows scripts need only to install and activate Family Historian. If you already have an install script that is valid for that PC (i.e. the correct Windows userid), simply run that script directly to restore all your settings (with Family Historian closed). Alternatively, you can copy the ProgramData and AppData folders back to their original locations manually, and extract the two Registry key files by simply double-clicking on them in Windows File Explorer.

Copying settings to a new or additional PC.

This is likely to be a common use of the plugin. The general process is very similar to that described above for restoring to the same PC. As before, the recommended backup locations are either a dedicated Family Historian Settings folder within your Documents library that you can copy across to the new PC before installing Family Historian, or a removable drive such as a portable hard disk or a USB memory stick.

If you are using the advanced mode to create a restore script directly, be aware that the file relates to settings on the PC that created it. Your user name and backup location may be different on the new PC, so will require editing.

Backups created by the plugin directly are completely compatible with backups created outside Family Historian, so it is perfectly possible to create the backup directly from the backup script, and restore it using the plugin.

Creating settings “snapshots” for easy recovery.

Settings backups can be used in the same way as Project “snapshots”, an easy way to revert to a previous configuration if you want to undo recent changes.

Suggested user extensions

There is no option within the plugin menu for selective restore of some features but not others (e.g., overwrite recent changes to Fact Sets, but keep recent changes to Queries). However, individual files within the backup folder can be copied back to their original location manually, so users who are familiar with where individual settings are stored have complete control over which versions are copied to their “live” Family Historian data.

If Write to dated subfolder is selected as an option for the saved backup script file, the date is a dynamic date, not a static one. That means that a new subfolder is created every time the script is run, even if done from outside Family Historian. If this process is automated, it will just keep adding subfolders to the backup location. Technically-minded users may choose to build their own routine to manage these data, say by automatically purging all data over a specified age.

There is no option within the core plugin to create zip archives, which can be useful for either saving disk space or simplifying the backup to a single file. A typical backup contains over 1500 files, and is 20 – 25 MB in size. This compresses to a single zip file of less than 5 MB. Technically-minded users can add their own zip commands to the backup scripts if required, either to create zip copies of the relevant ProgramData and AppData folders and extracted Registry keys directly, or zipping the files and folders created by the original script. The free open-source utility 7-Zip is ideal for this purpose, as it is designed to work either in a conventional window or directly from the command line.


Plugin Backup and Restore Family Historian Settings via Windows

Help content on this page is owned and provided by Mark Draper, the plugin's author, Calico Pie takes no responsibility for its content.